<?php
if ( !defined( "IN_UCHOME" ) )
{
	exit( "Access Denied" );
}
//判断游客是否可以浏览爆料
if($confignewss['noreg']==0){//游客是否可以浏览爆料,0为必须登陆
	checklogin( );
}
//获得用户的UID
if ( empty( $uid ) )
{
	$uid = $_SGLOBAL['supe_uid'];
}
if(!isset($_GET['newsid'])){
	showmessage('非法访问!', 'news.php',5);
}
$sql='select a.province,a.city,a.subcity,a.pic as pic,a.id as newsid,a.ip as ip,c.catname as catname,a.catid as catid,b.uid as uid,b.username as username,starttime,endtime,subject,detail from '.$_SC['tablepre'].'news_detail as a,'.$_SC['tablepre'].'member as b, '.$_SC['tablepre'].'news_category as c where a.uid=b.uid and c.catid=a.catid and  pass=0  and a.id='.$_GET['newsid'];
$query = $_SGLOBAL['db']->query( $sql );
if(mysql_num_rows($query)<1)
	showmessage('你查找的爆料不存在或未通过审核,请等待管理员审核!', 'news.php',5);
$news=mysql_fetch_array($query,1);
include_once('source/function_blog.php');
$news['detail']=blog_bbcode($news['detail']);
//查询回复爆料
//分页
$perpage = 10;
$list = $ols = $fuids = array();
$page = empty($_GET['page'])?0:intval($_GET['page']);
if($page<1) $page = 1;
$start = ($page-1)*$perpage;
//检查开始数
ckstart($start, $perpage);
$sql=	'select * from '.$_SC['tablepre'].'news_responds as a, '.$_SC['tablepre'].'member as b
			where a.uid=b.uid and a.status=0 and reviewid='.$_GET['newsid'];
$query = $_SGLOBAL['db']->query( $sql );
$count=mysql_num_rows($query);
$sql.=' order by posttime desc LIMIT '.$start.','.$perpage;
$query = $_SGLOBAL['db']->query( $sql );
while ($reviews_tmp=mysql_fetch_array($query,1)){
		$temp_news['rid']=$reviews_tmp['rid'];
		$temp_news['reviewid']=$reviews_tmp['reviewid'];
		$temp_news['uid']=$reviews_tmp['uid'];
		$temp_news['username']=$reviews_tmp['username'];
		$temp_news['content']=getstr($reviews_tmp['content'], 500, 0, 0, 0, 0, -1);
		$temp_news['posttime']=$reviews_tmp['posttime'];
		$responds[]=$temp_news;
		
	}
$theurl='news.php?ac=view&newsid='.$_GET['newsid'];
$multi['html']=multi($count, $perpage, $page, $theurl);
//查询回复爆料数结束
$_TPL['css'] = 'blog';
include_once( template( "news/template/news_view" ) );
?>